#@layout()

#define script()
<script src="/static/components/tinymce/tinymce.min.js"></script>
<script>

    $("#sync").on("click",function () {
        $.ajax({ url: "/admin/permission/syncPermissions",  success: function(result){
           alert(result.msg);
        }});
    })



    $("#chooseimage").on("click",function () {
        layer.open({
            type: 2,
            title: '选择图片',
            anim: 2,
            shadeClose: true,
            shade: 0.5,
            area: ['80%', '70%'],
            content: '/admin/menu/menu',
            end: function () {
                if ('' != data.url && null != data.url) {
                    callback(data.url, {alt: data.alt});
                }
            }
        });
    })


</script>
#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            权限管理
            <small>Permission manager</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#"> 用户</a></li>
            <li class="active">权限管理</li>
        </ol>
    </section>

    <section class="content-header text-tap">
        <a href="">全部 (24)</a>  |  <a href="">菜单 (22)</a>  |  <a href="">功能 (2)</a>  |  <a href="">自定义 (0)</a>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <form class="form-horizontal actionPanel">
                            <div class="row">
                                <div class="form-group col-xs-4">
                                    <label class="col-sm-3 control-label">功能</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" >
                                    </div>
                                </div>
                                <div class="form-group col-xs-4">
                                    <label  class="col-sm-3 control-label">描述</label>
                                    <div class="col-sm-9">
                                        <input  class="form-control" >
                                    </div>
                                </div>
                                <div class="form-group col-xs-4">
                                    <button type="submit" class="btn btn-primary ">查询</button>
                                    <button type="reset" class="btn btn-default">重置</button>
                                    <a class="btn"> 更多<i class="fa fa-fw fa-angle-down"></i> </a>
                                </div>
                            </div>
                            <!-- /.box-body -->
                        </form>

                        <div class="row actionPanel">
                            <div class="col-xs-12">
                                <button type="submit" class="btn btn-primary "> <i class="fa fa-fw fa-plus"></i> 新建</button>
                                <button type="button" id="sync" class="btn btn-default"> <i class="fa fa-fw fa-refresh"></i> 同步</button>
                                <button type="submit" class="btn btn-default checkAction"> 批量删除 </button>
                                <div  class="btn-group checkAction">
                                    <button type="button" class="btn btn-default">更多</button>
                                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                        <span class="caret"></span>
                                        <span class="sr-only">Toggle Dropdown</span>
                                    </button>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Action</a></li>
                                        <li><a href="#">Another action</a></li>
                                        <li><a href="#">Something else here</a></li>
                                        <li class="divider"></li>
                                        <li><a href="#">Separated link</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>

                    </div>
                    <!-- /.box-header -->
                    <div class="box-body ">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px"><input name="dataItem" onchange="checkAll(this)" type="checkbox" value="0" /></th>
                                <th style="width: 10px">#</th>
                                <th style="width: 100px">节点</th>
                                <th>功能</th>
                                <th>描述</th>
                                <th style="width: 80px">类型</th>
                            </tr>

                            #for(permission : page.list)
                            <tr>
                                <td><input class="dataItem" type="checkbox" value="32" onchange="dataItemChange(this)" /></td>
                                <td>#(permission.id ??)</td>
                                <td>#(permission.shortNode ??)</td>
                                <td>#(permission.action_key ??)</td>
                                <td>#(permission.text ??)</td>
                                <td>#(permission.typeText ??)</td>
                            </tr>
                            #end

                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                #@paginate()
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>

    </section>


</div>
#end
